package com.ruoyi.system.mapper;

import java.util.List;
import com.ruoyi.system.domain.HikVideoAllGroupFlowNew;
import org.apache.ibatis.annotations.Select;

/**
 * 客流信息Mapper接口
 *
 * @author ruoyi
 * @date 2025-03-14
 */
public interface HikVideoAllGroupFlowNewMapper
{
    /**
     * 查询客流信息
     *
     * @param id 客流信息主键
     * @return 客流信息
     */
    public HikVideoAllGroupFlowNew selectHikVideoAllGroupFlowNewById(Long id);

    /**
     * 查询客流信息列表
     *
     * @param hikVideoAllGroupFlowNew 客流信息
     * @return 客流信息集合
     */
    public List<HikVideoAllGroupFlowNew> selectHikVideoAllGroupFlowNewList(HikVideoAllGroupFlowNew hikVideoAllGroupFlowNew);

    /**
     * 新增客流信息
     *
     * @param hikVideoAllGroupFlowNew 客流信息
     * @return 结果
     */
    public int insertHikVideoAllGroupFlowNew(HikVideoAllGroupFlowNew hikVideoAllGroupFlowNew);

    /**
     * 修改客流信息
     *
     * @param hikVideoAllGroupFlowNew 客流信息
     * @return 结果
     */
    public int updateHikVideoAllGroupFlowNew(HikVideoAllGroupFlowNew hikVideoAllGroupFlowNew);

    /**
     * 删除客流信息
     *
     * @param id 客流信息主键
     * @return 结果
     */
    public int deleteHikVideoAllGroupFlowNewById(Long id);

    /**
     * 批量删除客流信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteHikVideoAllGroupFlowNewByIds(String[] ids);

    @Select("select flowInNum from hik_video_all_group_flow_new where addTime = #{time}")
    Integer countTodayFlow(String time);


    @Select("select sum(flowInNum) from hik_video_all_group_flow_new where addTime between DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY) AND " +
            "NOW()")
    Integer sevenFlow();

    @Select("select * from hik_video_all_group_flow_new where addTime = #{dateStr}")
    HikVideoAllGroupFlowNew selectHikVideoAllGroupFlowNewByAddTime(String dateStr);
}
